import { createRouter, createWebHistory } from 'vue-router'
import LoginView from '../views/LoginView/index.vue'
import HomeView from '../views/HomeView/index.vue'

import Dashboard from '../views/HomeView/LeftBar/Dashboard/Dashboard.vue'
import PakingPort from '../views/HomeView/LeftBar/PakingPort/PakingPort.vue'
import Settings from '../views/HomeView/LeftBar/Settings/Settings.vue'
import ObserveScreen from '../views/HomeView/LeftBar/ObserveScreen/ObserveScreen.vue'
import WrittingArtices from '../views/HomeView/LeftBar/WrittingArtices/WrittingArtices.vue'
import MineView from '../views/HomeView/LeftBar/MineView/MineView.vue'
import AiView from '../views/HomeView/LeftBar/AiView/AiView.vue'
import WpsView from '../views/HomeView/LeftBar/WpsView/WpsView.vue'
import DrawView from '../views/HomeView/LeftBar/DrawView/DrawView.vue'

// 三级路由
import PersonDetail from '../views/HomeView/LeftBar/Settings/PersonDetail/PersonDetail.vue'
import AccountSetting from '../views/HomeView/LeftBar/Settings/AccountSetting/AccountSetting.vue'
import MessageSetting from '../views/HomeView/LeftBar/Settings/MessageSetting/MessageSetting.vue'
import GeneralSetting from '../views/HomeView/LeftBar/Settings/GeneralSetting/GeneralSetting.vue'
import IndexView from '../views/HomeView/LeftBar/IndexView/IndexView.vue'

const router = createRouter({
  history: createWebHistory('/'),
  routes: [
    {
      path: '/',
      name: 'LoginView',
      component: LoginView,
    },
    {
      path: '/HomeView',
      name: 'HomeView',
      component: HomeView,
      children: [
        {
          path: '', // 默认子路由
          redirect: 'dashboard',
        },

        {
          path: 'dashboard',
          name: 'Dashboard',
          component: Dashboard,
        },
        {
          path: 'pakingPort',
          name: 'PakingPort',
          component: PakingPort,
        },
        {
          path: 'observeScreen',
          name: 'ObserveScreen',
          component: ObserveScreen,
        },
        {
          path: 'writtingArtices',
          name: 'WrittingArtices',
          component: WrittingArtices,
        },
        {
          path: 'wpsView',
          name: 'WpsView',
          component: WpsView,
        },
        {
          path: 'drawView',
          name: 'DrawView',
          component: DrawView,
        },

        {
          path: 'settings',
          name: 'Settings',
          component: Settings,
          // 添加子路由
          children: [
            {
              path: '', // 默认子路由
              redirect: 'settings',
            },
            {
              path: 'personDetail',
              name: 'PersonDetail',
              component: PersonDetail,
            },
            {
              path: 'accountSetting',
              name: 'AccountSetting',
              component: AccountSetting,
            },
            {
              path: 'messageSetting',
              name: 'MessageSetting',
              component: MessageSetting,
            },
            {
              path: 'generalSetting',
              name: 'GeneralSetting',
              component: GeneralSetting,
            },
          ],
        },
        {
          path: 'mineView',
          name: 'MineView',
          component: MineView,
        },
        {
          path: 'indexView',
          name: 'IndexView',
          component: IndexView,
        },
        {
          path: 'aiView',
          name: 'AiView',
          component: AiView,
        },
      ],
    },
  ],
})

export default router
